import numpy as np 
import glumpy

# fig is the window to which you will draw.
# you need to tell glumpy how big you want the window.
# in this case the window is 512 pixels in the x direction by 512 pixels in the y direction
# the origin of the window (0,0) is at the top left
fig = glumpy.figure( (512,512) )
# Z = np.random.random((32,32)).astype(np.float32)
Z = np.ones((512,512), dtype=np.float32)

# "image" is the content of the window that you will draw onto
# you can think of this as the "canvas"
image = glumpy.image.Image(Z)

def on_draw():
    fig.clear()
    image.update()
    image.draw( x=0, y=0, z=0, width=fig.width, height=fig.height )

fig.window.push_handlers(on_draw)
glumpy.show()